<?php


namespace app\admin\validate;


use think\Validate;

class CustomerServiceAccount extends Validate
{
    //字段规则
    protected $rule = [
        'username' => 'require|unique:customer_service_account',
        'customer_service_personnel_id' => 'require',
    ];

    //验证器提示信息
    protected $message = [
        'username.require' => '客服账号不能为空',
        'username.unique' => '客服账号已被注册',
        'customer_service_personnel_id.require' => '请选择客服人员',
    ];

    //使用场景
    protected $scene = [
        'add' => ['username', 'customer_service_personnel_id'],
        'edit' => ['username' => 'require', 'customer_service_personnel_id']
    ];
}